package com.yjck.jwt.controller;

import com.yjck.jwt.entity.TbUser;
import com.yjck.jwt.service.ISysUserService;
import com.yjck.jwt.utils.JwtUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin")
public class SysUserController {

    @Autowired
    public ISysUserService sysUserService;

    @PostMapping("/login")
    public Object login(String userId) {
        String token = JwtUtil.createJwt(userId);
        System.out.println(token);
        return token;
    }

    @GetMapping("/login")
    public void getUser(TbUser tbUser) {
        System.out.println(tbUser);
    }
}
